// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from '@/common/js/http'
import Vuex from 'vuex';
import store from './store1';
import iView from 'iview';
import 'iview/dist/styles/iview.css';
import '@/assets/main.css';
// import '@/assets/css/normalize.css'
// import '@/assets/css/base.css'
// import '@/assets/css/common.css'
import formatDate from './common/js/date';
// import directive from './directive/directive';
Vue.use(iView);

Vue.use(require('vue-wechat-title'))

if(window.location.host.indexOf('localhost')!=-1||window.location.host.indexOf('192.')!=-1){
    Vue.prototype.imgRequest = 'http://www.appbale.net/'
}else{
    Vue.prototype.imgRequest = window.location.origin    
}
    //接口地址
Vue.prototype.$http = axios //其他页面在使用axios的时候直接  this.$http就可以了
Vue.config.productionTip = false
//使用进度条
router.beforeEach((to, from, next) => {
    iView.LoadingBar.start();
    next()
});
router.afterEach(route => {
    iView.LoadingBar.finish();
    window.scrollTo(0,0);
});

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    formatDate,
    render: h => h(App)
});
